package com.springboot.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.demo.entity.Notice;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NoticeMapper extends BaseMapper<Notice> {

    //查询距离当前日期最近的数据
    @Select("select max(date) from notice")
    String getLastDate();

    //按日期顺序获取列表
    @Select("Select * From Notice ORDER BY Date desc")
    List<Notice> getNoticeByOrder();

}
